import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

public class Test {
    public static void main(String[] args) {
        HashBuck hashBuck = new HashBuck();
        hashBuck.put(1,888);
        hashBuck.put(12,888);
        hashBuck.put(2,888);
        hashBuck.put(14,888111);
        hashBuck.put(4,888);
        hashBuck.put(8,888);
        hashBuck.put(7,888);
        hashBuck.put(5,888);
        hashBuck.put(6,888);

        System.out.println(hashBuck.get(14));
    }

    public static void main3(String[] args) {
        Set<String> set = new TreeSet<>();
        set.add("abc");
        set.add("hello");
        set.add("ok");
        set.add("main");
        System.out.println(set);
    }

    public static void main2(String[] args) {
        // hello : 5
        Map<String,Integer> map = new TreeMap<>();
        //根据 key 来比较大小的
        map.put("hello",5);
        map.put("abc",2);
        map.put("ko",3);

        Set<Map.Entry<String,Integer>> entries = map.entrySet();
        for (Map.Entry<String, Integer> entry : entries) {
            String key = entry.getKey();
            Integer val = entry.getValue();
            System.out.println("key: "+key +" val: "+val);
        }
    }

    public static void main1(String[] args) {
        int[] array = {5,10,3,1,15};
        BinarySearchTree binarySearchTree = new BinarySearchTree();
        for (int i = 0; i < array.length; i++) {
            binarySearchTree.insert(array[i]);
        }

        System.out.println(binarySearchTree.search(51));
    }
}
